﻿action_has_open_court_event = {
	type = alert

	check_create_action = {
		if = {
			limit = {
				has_ep1_dlc_trigger = yes
				has_local_player_open_court_event = yes
			}

			try_create_important_action = {
				important_action_type = action_has_open_court_event
			}
		}
	}

	effect = {
		if = {
			limit = {
				OR = {
					carnal_court_has_sex_animation_event_trigger = yes
					liege = { carnal_court_has_sex_animation_event_trigger = yes }
				}
			}
			open_view_data = {
				view = royal_court
				secondary_actor = root
				player = root
			}
		}
		else_if = {
			limit = { has_royal_court = yes }
			open_view_data = {
				view = royal_court
				player = root
			}
		}
		else = {
			liege = {
				open_view_data = {
					view = royal_court
					secondary_actor = root
					player = root
				}
			}
		}
	}
}